Array.prototype.remove = function (target) {
  this.splice(this.indexOf(target), 1);
}

function getRandom(min, max) {
  return Math.floor(Math.random() * (max - min) + min);
}

function getPlayerPlaneInfo() {
  return [(MAX_WIDTH - this.size_w) / 2, MAX_HEIGHT - 150,
  `./img/${this.name}.png`, this.size_w,
  this.size_h, this.speed, this.blood];
}

function getBulletInfo() {
  return [`./img/${this.name}.png`, this.size_w, this.size_h, this.speed, this.hurt];
}

function getEnemyInfo() {
  return [getRandom(0, MAX_WIDTH - this.size_w),
  - this.size_h, `./img/${this.name}.png`, this.size_w,
  this.size_h, this.speed, this.blood, this.score];
}



function renderStatistic(s, k, b) {
  score.innerHTML = s;
  kill.innerHTML = k;
  blood.innerHTML = b;
}

function showGame(text) {
  var div = document.createElement('div');
  div.innerText = text;
  div.className = 'show-text';
  div.style.top = (MAX_HEIGHT / 2 - 15) + 'px';
  container.appendChild(div);
  setTimeout(() => {
    div.remove();
  }, 5000);
}